package com.tutucms.service.auth.impl;

import com.tutucms.service.auth.UserContextCache;
import com.tutucms.service.cache.CacheService;

/**
 * Created by wangxudong on 2020/10/28.
 *
 * @version: 1.0
 * @modified :
 */
public class DefaultUserContextCache implements UserContextCache {

    private CacheService cacheService;

    @Override
    public void set(String key, Object value, long expire) {

        cacheService.set(key, value, expire);
    }

    @Override
    public <T> T get(String key, Class<T> clazz) {

        return cacheService.get(key, clazz);
    }

    @Override
    public <T> T get(String key, Class<T> clazz, long expire) {

        return cacheService.get(key, clazz, expire);
    }

    @Override
    public void delete(String key) {

        cacheService.delete(key);
    }

    public void setCacheService(CacheService cacheService) {
        this.cacheService = cacheService;
    }
}
